/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.jfonia.model;

import java.util.LinkedHashSet;
import java.util.Set;
import org.jfonia.connect5.intervals.Interval;
import org.jfonia.model.elements.MusicalElement;
import percussiongenerator.model.Pair;

/**
 *
 * @author jannes
 */
public abstract class SequenceObservable{
    /*
    Set<ISequenceObserver> observers = new LinkedHashSet<ISequenceObserver>();

    public void addObserver(ISequenceObserver o)
    {
        if (!observers.contains(o))
                observers.add(o);
    }

    public boolean containsObserver(ISequenceObserver o)
    {
        return observers.contains(o);
    }

    public void removeObserver(ISequenceObserver o)
    {
        observers.remove(o);
    }

    public void nodeAdded(SequenceOld sequence, Pair<MusicalElement,PerformanceNode> nodes){
        for(ISequenceObserver observer : observers){
            observer.nodeAdded(sequence,nodes);
        }
    }

    public void nodeRemoved(SequenceOld sequence, MusicalElement musicalElement){
        for(ISequenceObserver observer : observers){
            observer.nodeRemoved(sequence,musicalElement);
        }
    }

    public void nodeRemoved(SequenceOld sequence, PerformanceNode performanceNode){
        for(ISequenceObserver observer : observers){
            observer.nodeRemoved(sequence,performanceNode);
        }
    }
    
    public void nodeDifferenceChanged(SequenceOld sequence, MusicalElement musicalElement){
        for(ISequenceObserver observer : observers){
            observer.nodeDifferenceChanged(sequence, musicalElement);
        }
    }

    public void nodeDifferenceChanged(SequenceOld sequence, PerformanceNode performaneNode){
        for(ISequenceObserver observer : observers){
            observer.nodeDifferenceChanged(sequence, performaneNode);
        }
    }
    */
}
